package com.lenovo.smarttraffic.ui.fragment;


import android.os.Bundle;
import android.os.SystemClock;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;

import com.lenovo.smarttraffic.R;
import com.lenovo.smarttraffic.ui.activity.BaseActivity;

/**
 * A simple {@link Fragment} subclass.
 * 没用
 */
public class FourthFragment extends BaseFragment {
    private String firsttab;
    private ListView lv_fg4;
    private SwipeRefreshLayout swipeRefreshLayout_fg4;


    @Override
    protected View getSuccessView() {
        Bundle bundle = getArguments();
        if (bundle != null) {
            firsttab = bundle.getString("FourthFragment");
        } else {
            firsttab = "";
        }
        View view = View.inflate(getActivity(), R.layout.fragment_fourth, null);
        initView(view);
        return view;
    }

    private void initView(View view) {
        lv_fg4 = view.findViewById(R.id.lv_fg4);
        swipeRefreshLayout_fg4 = view.findViewById(R.id.swipeRefreshLayout_fg4);
    }

    @Override
    protected Object requestData() {
        SystemClock.sleep(1000);/*模拟请求服务器的延时过程*/
        return null;/*加载失败*/
    }

    @Override
    public void onClick(View view) {

    }

    public static FourthFragment onNewBundle(String args) {
        FourthFragment fourthFragment = new FourthFragment();
        Bundle bundle = new Bundle();
        bundle.putString("FourthFragment", args);
        fourthFragment.setArguments(bundle);
        return fourthFragment;
    }
}
